#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<stack>
#include<list>
#include<queue>
int main(int argc, char** argv){
	FILE * inf;
	FILE * outf;
	long long v,e;
	inf=fopen(argv[1],"r");
	outf=fopen(argv[2],"w");
	fscanf(inf,"%lld %lld\n",&v,&e);
	printf("%lld %lld\n",v,e);
	bool** con;
	con =new bool*[v];
	for(long long i=0;i<v;i++){
		con[i]=new bool[v];
		for(long long j=0;j<v;j++){
			con[i][j]=0;
		}
	}
/*
	for(long long i=0;i<v;i++){
		con[i][i]=1;
	}
*/
	for(long long i=0;i<e;i++){
		long long v1,v2;
		fscanf(inf,"%lld %lld\n",&v1,&v2);
		con[v1][v2]=1;
		con[v2][v1]=1;
	}
	double cb[v];
	for(long long i=0;i<v;i++){
		cb[i]=0;
	}
	std::stack<long long> st;
	std::list<long long> p[v];
	long long th[v];
	long long d[v];
	std::queue<long long> q;
	double sgm[v];
	long long w;
	long long vi;
	for(long long s=0;s<v;s++){
		while(!st.empty()){
			st.pop();
		}
		for(long long i=0;i<v;i++){
			p[i].clear();
			if(i==s){
				th[i]=1;
				d[i]=0;
			}else{
				th[i]=0;
				d[i]=-1;
			}

		}
		while(!q.empty()){
                        q.pop();
                }
		q.push(s);
		while(!q.empty()){
			vi=q.front();
			st.push(vi);
			q.pop();
			for(long long i=0;i<v;i++){
				if(con[vi][i]){
					if(d[i]<0){
						q.push(i);
						d[i]=d[vi]+1;
					}
					if(d[i]==d[vi]+1){
						th[i]+=th[vi];
						p[i].push_back(vi);
					}
				}
			}
		}
		for(long long i=0;i<v;i++){
			sgm[i]=0;
		}
		while(!st.empty()){
			w=st.top();
			st.pop();
			for(std::list<long long>::iterator it=p[w].begin();it!=p[w].end(); ++it){
				sgm[*it]+=((th[*it]+0.0)/(th[w]+0.0))*(1+sgm[w]);
			}
			if(w!=s){
				cb[w]+=sgm[w];
			}
		}
	}
	for(long long i=0;i<v;i++){
		fprintf(outf,"%lld %lf\n",i,cb[i]);
	}
	fclose(inf);
	fclose(outf);
}
